package com.ycz.service;

import com.ycz.entity.User;
import com.ycz.mapper.UserMapper;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author ycz
 * @date 2021/6/18
 * @description TODO
 * @Company © 版权所有 深圳市天行云供应链有限公司
 */
@Service
public class UserService {

    @Autowired
    UserMapper userMapper;

    @Autowired
    SqlSessionFactory sqlSessionFactory;

    public void getById() {
        User user = userMapper.getById();
        System.out.println(user.toString());
//        System.out.println(JacksonUtil.toJsonString(user));
    }

    @Transactional
    public void insert() {
        userMapper.insert();
    }


}
